Optimal. Leaf size=449 \[ \frac {2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}+\frac {2 \left (a^2+b^2\right ) \cot (c+d x) E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {-\frac {b (-1+\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a (a-b) (a+b)^{3/2} d}-\frac {\left (a^2-a b+2 b^2\right ) \cot (c+d x) F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {-\frac {b (-1+\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a (a-b) (a+b)^{3/2} d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {2 b^2 \left (a^2+b^2\right ) \tan (c+d x)}{a \left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.65, antiderivative size = 664, normalized size of antiderivative = 1.48, number of steps
used = 14, number of rules used = 11, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.478, Rules used = {3981, 3870,
4143, 4006, 3869, 3917, 4089, 3960, 3918, 4088, 4090} \begin {gather*} \frac {2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a^2 d}-\frac {2 b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) \sqrt {a+b \sec (c+d x)}}+\frac {4 a b^2 \tan (c+d x)}{d \left (a^2-b^2\right )^2 \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))^{3/2}}+\frac {2 \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a d \sqrt {a+b}}-\frac {(3 a-b) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d (a-b) (a+b)^{3/2}}-\frac {2 \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a d \sqrt {a+b}}+\frac {4 a \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d (a-b) (a+b)^{3/2}}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3869
Rule 3870
Rule 3917
Rule 3918
Rule 3960
Rule 3981
Rule 4006
Rule 4088
Rule 4089
Rule 4090
Rule 4143
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx &=\int \left (-\frac {1}{(a+b \sec (c+d x))^{3/2}}+\frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}}\right ) \, dx\\ &=-\int \frac {1}{(a+b \sec (c+d x))^{3/2}} \, dx+\int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx\\ &=-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {1}{2} (3 b) \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^{5/2}} \, dx+\frac {2 \int \frac {\frac {1}{2} \left (-a^2+b^2\right )+\frac {1}{2} a b \sec (c+d x)+\frac {1}{2} b^2 \sec ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}\\ &=-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}+\frac {2 \int \frac {\frac {1}{2} \left (-a^2+b^2\right )+\left (\frac {a b}{2}-\frac {b^2}{2}\right ) \sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}+\frac {b \int \frac {\sec (c+d x) \left (-\frac {3 a}{2}+\frac {1}{2} b \sec (c+d x)\right )}{(a+b \sec (c+d x))^{3/2}} \, dx}{a^2-b^2}+\frac {b^2 \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{a \left (a^2-b^2\right )}\\ &=-\frac {2 \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {\int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx}{a}+\frac {b \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{a (a+b)}-\frac {(2 b) \int \frac {\sec (c+d x) \left (\frac {1}{4} \left (3 a^2+b^2\right )+a b \sec (c+d x)\right )}{\sqrt {a+b \sec (c+d x)}} \, dx}{\left (a^2-b^2\right )^2}\\ &=-\frac {2 \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {((3 a-b) b) \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{2 (a-b) (a+b)^2}-\frac {\left (2 a b^2\right ) \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{\left (a^2-b^2\right )^2}\\ &=\frac {4 a \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{(a-b) (a+b)^{3/2} d}-\frac {2 \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}-\frac {(3 a-b) \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{(a-b) (a+b)^{3/2} d}+\frac {2 \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a \sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a^2 d}-\frac {\cot (c+d x)}{d (a+b \sec (c+d x))^{3/2}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))^{3/2}}+\frac {4 a b^2 \tan (c+d x)}{\left (a^2-b^2\right )^2 d \sqrt {a+b \sec (c+d x)}}-\frac {2 b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 13.68, size = 663, normalized size = 1.48 \begin {gather*} \frac {(b+a \cos (c+d x))^2 \sec ^2(c+d x) \left (\frac {\left (2 a b-a^2 \cos (c+d x)-b^2 \cos (c+d x)\right ) \csc (c+d x)}{\left (-a^2+b^2\right )^2}-\frac {2 b \left (a^2+b^2\right ) \sin (c+d x)}{a \left (a^2-b^2\right )^2}+\frac {2 b^4 \sin (c+d x)}{a \left (a^2-b^2\right )^2 (b+a \cos (c+d x))}\right )}{d (a+b \sec (c+d x))^{3/2}}-\frac {2 \cos ^2\left (\frac {1}{2} (c+d x)\right ) (b+a \cos (c+d x)) \sec ^2(c+d x) \left (-2 i b \left (-a^3+a^2 b-a b^2+b^3\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} E\left (i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )+i \left (2 a^4-a^3 b-2 a^2 b^2-3 a b^3+4 b^4\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} F\left (i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )-4 i \left (a^2-b^2\right )^2 \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )-b \sqrt {\frac {-a+b}{a+b}} \left (a^2+b^2\right ) \cos (c+d x) (b+a \cos (c+d x)) \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \sqrt {\frac {-a+b}{a+b}} \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(2238\) vs.
\(2(416)=832\).
time = 0.21, size = 2239, normalized size = 4.99
method | result | size |
default | \(\text {Expression too large to display}\) | \(2239\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\mathrm {cot}\left (c+d\,x\right )}^2}{{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________